const Controller = require('../../core/controller/ApiController');
const {Route, HttpGet,HttpPost, Middleware, filters} = require('../../../plugin/egg-decorator-router/lib');
const {ExceptionHandler} = require('../../../plugin/egg-controller-exception-handler/lib');


@Route('/api/info/infoAns')

class AnsCtrl extends Controller{

    //正反字接口1
    @HttpPost('/insert')
    @ExceptionHandler()
    async insertInfo() {
        const rule = {
            name:'string',
            age:'int',
            sex:'int',
            total_score:'string',
            total_time:'string',
            all_score_list:'string',
            all_time_list:'string',
            wrong_list:'string',
            click_count_list:'string'

        }
        this.validate(rule,this.ctx.request.body);
        this.result.data = await this.service.info.infoAns.main.insertInfo(this.ctx.request.body);
        return '添加成功'
    }

    //视知觉
    @HttpPost('/visualUser')
    @ExceptionHandler()
    async visualInfo() {
        const rule = {
            name:'string',
            age:'int',
            sex:'int',
            part1_task1_time:'string',
            part1_task2_time:'string',
            part1_task3_time:'string',
            part1_task3_path_list:'string',
            part1_task3_target_count:'string',
            part2_task1_time:'string',
            part2_task2_time:'string',
            part2_task3_time:'string',
            part2_task3_path_list:'string',
            part2_task3_target_count:'string',
            part3_task1_time:'string',
            part3_task2_time:'string',
            part3_task3_time:'string',
            part3_task3_path_list:'string',
            part3_task3_target_count:'string',
            part4_task1_time:'string',
            part4_task2_time:'string',
            part4_task3_time:'string',
            part4_task3_path_list:'string',
            part4_task3_target_count:'string',
            part5_task1_time:'string',
            part5_task2_time:'string',
            part5_task3_time:'string',
            part5_task3_path_list:'string',
            part5_task3_target_count:'string',
            part6_task1_time:'string',
            part6_task2_time:'string',
            part6_task3_time:'string',
            part6_task3_path_list:'string',
            part6_task3_target_count:'string',
            total_time:'string'


        }
        this.validate(rule,this.ctx.request.body);
        this.result.data = await this.service.info.infoAns.main.createVisualInfo(this.ctx.request.body);
        return '添加成功'
    }



    //正反字接口2
    @HttpPost('/children2')
    @ExceptionHandler()
    async children2() {
        const rule = {
            name2:'string',
            age2:'int',
            sex2:'int',
            total_score2:'string',
            total_time2:'string',
            first1_score_list:'string',
            first1_time_list:'string',
            first1_wrong_list:'string',
            first1_click_list:'string',
            first2_score_list:'string',
            first2_time_list:'string',
            first2_wrong_list:'string',
            first2_click_list:'string',

            two1_score_list:'string',
            two1_time_list:'string',
            two1_wrong_list:'string',
            two1_click_list:'string',
            two2_score_list:'string',
            two2_time_list:'string',
            two2_wrong_list:'string',
            two2_click_list:'string',

            three1_score_list:'string',
            three1_time_list:'string',
            three1_wrong_list:'string',
            three1_click_list:'string',
            three2_score_list:'string',
            three2_time_list:'string',
            three2_wrong_list:'string',
            three2_click_list:'string',

            four1_score_list:'string',
            four1_time_list:'string',
            four1_wrong_list:'string',
            four1_click_list:'string',
            four2_score_list:'string',
            four2_time_list:'string',
            four2_wrong_list:'string',
            four2_click_list:'string',

            five1_score_list:'string',
            five1_time_list:'string',
            five1_wrong_list:'string',
            five1_click_list:'string',
            five2_score_list:'string',
            five2_time_list:'string',
            five2_wrong_list:'string',
            five2_click_list:'string',





        }
        this.validate(rule,this.ctx.request.body);
        this.result.data = await this.service.info.infoAns.main.children2(this.ctx.request.body);
        return '添加成功'
    }

    @HttpPost('/children3')
    @ExceptionHandler()
    async children3() {
        const rule = {
            name:'string',
            age:'int',
            sex:'int',
            total_score:'string',
            total_time:'string',

            part1_score:'string',
            part1_time:'string',
            part1_wrong_list:'string',
            part1_click_count_list:'string',

            part2_score:'string',
            part2_time:'string',
            part2_wrong_list:'string',
            part2_click_count_list:'string',

            part3_score:'string',
            part3_time:'string',
            part3_wrong_list:'string',
            part3_click_count_list:'string',
        }
        this.validate(rule,this.ctx.request.body);
        this.result.data = await this.service.info.infoAns.main.children3(this.ctx.request.body);
        return '添加成功'
    }

}
module.exports = AnsCtrl;
